
/*

Design Pattern Automation Toolkit.
Application to create applications with emphasis on Design patterns.
And support for round trip engineering.
Copyright (C) 2004 Vineeth Neelakant. nvineeth@gmail.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
using System;using BusinessLayer;using InfoClasses;using dpatoolkit.UILayer;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace dpatoolkit.UILayer
{
	/// <summary>
	/// 
	/// </summary>
	public class UIRenderer //: IUILookAndFeelProvider 
	{
		static  UIRenderer()
		{
			UIRenderer.UIStringFormat = new StringFormat();
			UIRenderer.UIStringFormat.LineAlignment = StringAlignment.Near;
			UIRenderer.UIStringFormat.Alignment = StringAlignment.Near;
			ClsUIStringFormat = new StringFormat();
			UIRenderer.ClsUIStringFormat.LineAlignment = StringAlignment.Center;
			UIRenderer.ClsUIStringFormat.Alignment = StringAlignment.Center;
		}

		#region fields
		public static StringFormat  ClsUIStringFormat ;

        private static Rectangle canvasRec_ = new Rectangle(0, 0, 10, 10);
        private static LinearGradientBrush canvasBrush_ = new LinearGradientBrush(
                           canvasRec_,
                           Color.FromArgb(0xba, 0xbd, 0xb6),
                           Color.FromArgb(0xee, 0xee, 0xec),
                           LinearGradientMode.Vertical);

		static public LinearGradientBrush 
			
			remoteClassBrush = new LinearGradientBrush(
            canvasRec_,
			Color.LightGray,
			Color.LightGray,
			LinearGradientMode.Vertical);

		public static Brush ClassBrush(System.Drawing.Rectangle rec)
		{
			return new LinearGradientBrush(
						   rec,
                           Color.FromArgb(0xba,0xbd,0xb6),
                           Color.FromArgb(0xee, 0xee, 0xec),
						   LinearGradientMode.Vertical);
		}

        public static Color CanvasColor = Color.FromArgb(0x2e, 0x34, 0x36);
            


		public static Brush RemoteClassBrush( System.Drawing.Rectangle rec)
		{
			return remoteClassBrush;
        }

        #region Fonts
        static public  System.Drawing.Font ConcreteClassFont= new Font("Tahoma", 8.25f);
        public static System.Drawing.Font AbstractClassFont = new Font("Tahoma", 8.25f, FontStyle.Italic, GraphicsUnit.Point);
        public static System.Drawing.Font ConcreteMethodFont = new Font("Tahoma", 8.25f);
        public static System.Drawing.Font AbstractMethodFont = new Font("Tahoma", 8.25f, FontStyle.Italic);
        public static System.Drawing.Font FieldFont = new Font("Microsoft Sans Seriff", 8.25f);
        public static System.Drawing.Font RelationFont = new Font("Tahoma", 8.25f);
        #endregion

        public static bool EnableShadows = false;
        public static Pen ActiveClassBoundaryPen = new Pen(Color.Ivory);
        //public static Pen ActiveClassBoundaryPen = new Pen(Color.FromArgb(0x72, 0x9f, 0xcf));
        public static Pen HiddenClassBoundaryPen = Pens.LightGreen;

        #region Grid Lines
        public static bool EnableGridLines = false;
        public static Pen MinorGridLinePen = new Pen(Color.FromArgb(0x0feeeeec), 0.15f);
        public static Pen MajorGridLinePen = new Pen(Color.FromArgb(0x3f729fcf), 0.45f);
        #endregion

        #region Reference Settings
        public static Color SingleAggregateColor = Color.FromArgb(0xfc, 0xe9, 0x4f);
        public static Color MultiAggregateColor = Color.FromArgb(0xfc, 0xe9, 0x4f);
        public static Color SingleReferenceColor = Color.FromArgb(0xfc, 0xaf, 0x3e);
        public static Color MultiReferenceColor = Color.FromArgb(0xfc, 0xaf, 0x3e);
        public static Color SingleCreatesColor = Color.FromArgb(0xe9, 0xb9, 0x6e);
        public static Color MultiCreatesColor = Color.FromArgb(0xe9, 0xb9, 0x6e);
        public static Color InheritanceColor = Color.FromArgb(0x73,0xd2,0x16);
        public static float RelationPenSize = 1.0f;
        #endregion

        public static Color ActiveLinkColor     = Color.FromArgb(0xee, 0xee, 0xec);
        public static Color InactiveLinkColor   = Color.FromArgb(0xba, 0xbd, 0xb6);
        public static Color ActiveLinkBG        = Color.FromArgb(0x2e, 0x34, 0x36);
        public static Color InactiveLinkBG = Color.FromArgb(0x88, 0x8a, 0x85);

        public static System.Drawing.SizeF MeasureString(string str,Graphics g,Font f) {
			return g.MeasureString( " " + str + " ",f );
            
            
		}

		public static StringFormat UIStringFormat;

		#endregion
	}
}
